package com.lykj.llw.box.adapter

import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.lykj.lib_base.component.GlideApp
import com.lykj.llw.box.R
import com.lykj.llw.box.data.bean.response.GameCommentResponse

/**
 * ================================================
 * 游戏评论适配器
 * ================================================
 *
 * @author gosha
 * @date 2023/12/6-16:01
 */
class GameCommentAdapter :
    BaseQuickAdapter<GameCommentResponse.DataDTO.RowsDTO, BaseViewHolder>(R.layout.item_game_comment) {
    override fun convert(holder: BaseViewHolder, item: GameCommentResponse.DataDTO.RowsDTO) {
        holder.setText(R.id.tv_name, "${item.username}")
        holder.setText(R.id.tv_time, "${item.opTime}")
        holder.setText(R.id.tv_comment, "${item.content}")


        GlideApp.with(context)
            .load(item.headPic)
            .circleCrop()
            .transition(DrawableTransitionOptions.withCrossFade())
            .into(holder.getView(R.id.iv_avatar))
    }
}